// node-sass配置 01
const sassResourcesLoader = require('craco-sass-resources-loader')
// 配置src别名 01
const CracoAlias = require('craco-alias')
// 配置babelrc 01
const BabelRcPlugin = require('@jackwilsdon/craco-use-babelrc')

module.exports = {
  devServer: {
    port: 3000,
    open: false
  },
  // node-sass配置 02
  plugins: [
    {
      plugin: sassResourcesLoader,
      options: {
        resources: ['./src/assets/scss/_mixin.scss', './src/assets/scss/_variable.scss'] // multiple
      }
    },
    // 配置src别名 02
    {
      plugin: CracoAlias,
      options: {
        source: 'options',
        baseUrl: './',
        aliases: {
          '@': './src'
        }
      }
    },
    // 配置babelrc 02
    { plugin: BabelRcPlugin }
  ]
}
